<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!-- Схема разработана Центром актуализации и модернизации руководств по структурированным электронным медицинским документам ЦНИИОИЗ 2022 -->
<!-- Включены элементы разработанные Health Level Seven -->
<xs:schema xmlns:mif="urn:hl7-org:v3/mif"
	xmlns="urn:hl7-org:v3" xmlns:hl7="urn:hl7-org:v3" xmlns:xs="http://www.w3.org/2001/XMLSchema"
	targetNamespace="urn:hl7-org:v3" elementFormDefault="qualified"
	xmlns:address="urn:hl7-ru:address" xmlns:fias="urn:hl7-ru:fias" xmlns:PII="urn:hl7-ru:PII"
	xmlns:identity="urn:hl7-ru:identity" xmlns:medService="urn:hl7-ru:medService">
	<!--
*****************************************************************************************************************
* XML schema for message type POCD_MT000040.
* Generated by XMLITS version 2.0
*
* Copyright (c) 2002, 2003, 2004, 2005 Health Level Seven. All rights reserved.
*  Redistribution and use in source and binary forms, with or without
*  modification, are permitted provided that the following conditions
*  are met:
*  1. Redistributions of source code must retain the above copyright
*     notice, this list of conditions and the following disclaimer.
*  2. Redistributions in binary form must reproduce the above copyright
*     notice, this list of conditions and the following disclaimer in the
*     documentation and/or other materials provided with the distribution.
*  3. All advertising materials mentioning features or use of this software
*     must display the following acknowledgement:
*       This product includes software developed by Health Level Seven.
*  THIS SOFTWARE IS PROVIDED BY HEALTH LEVEL SEVEN, INC. AND CONTRIBUTORS "AS IS" AND
*  ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
*  IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
*  ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
*  FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
*  DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
*  OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
*  HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
*  LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
*  OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
*  SUCH DAMAGE.
*
********************************************************************************************************************
	  -->
	<xs:import namespace="urn:hl7-ru:PII" schemaLocation="PII.xsd"/>
	<xs:import namespace="urn:hl7-ru:fias" schemaLocation="fias.xsd"/>
	<xs:import namespace="urn:hl7-ru:address" schemaLocation="address.xsd"/>
	<xs:import namespace="urn:hl7-ru:identity" schemaLocation="identity.xsd"/>
	<xs:import namespace="urn:hl7-ru:medService" schemaLocation="medService.xsd"/>
	<xs:include schemaLocation="coreschemas/datatypes.xsd"/>
	<xs:include schemaLocation="coreschemas/voc.xsd"/>
	<xs:include schemaLocation="coreschemas/NarrativeBlock.xsd"/>
	
	<!-- Блоки "Сведения об организации (страховой компании или юридическом лице)" и "Сведения об организации, где работает направившее лицо" -->
	<xs:complexType name="POCD_MT000040.Organization_1">
		<xs:sequence>
			<xs:choice minOccurs="0">
				<xs:sequence>
					<xs:element name="id" minOccurs="1" maxOccurs="1">
						<xs:annotation>
							<xs:documentation>уникальный идентификатор организации</xs:documentation>
						</xs:annotation>
						<xs:complexType>
							<xs:complexContent>
								<xs:restriction base="II">
									<xs:attribute name="root" type="uid" use="optional"/>
									<xs:attribute name="extension" type="st" use="optional"/>
									<xs:attribute name="assigningAuthorityName" type="st" use="prohibited"/>
									<xs:attribute name="displayable" type="bl" use="prohibited"/>
									<xs:attribute name="nullFlavor" type="NullFlavor" use="optional"/>
								</xs:restriction>
							</xs:complexContent>
						</xs:complexType>
					</xs:element>
					<xs:element name="name" type="ON" minOccurs="1" maxOccurs="1">
						<xs:annotation>
							<xs:documentation>наименование организации</xs:documentation>
						</xs:annotation>
					</xs:element>
					<xs:element name="telecom" type="TEL" minOccurs="0" maxOccurs="unbounded">
						<xs:annotation>
							<xs:documentation>контакты организации</xs:documentation>
						</xs:annotation>
					</xs:element>
					<xs:element name="addr" minOccurs="0" maxOccurs="1">
						<xs:annotation>
							<xs:documentation>адрес организации</xs:documentation>
						</xs:annotation>
						<xs:complexType>
							<xs:choice minOccurs="0">
								<xs:group ref="AD"/>
							</xs:choice>
							<xs:attribute name="use" use="optional" type="set_PostalAddressUse"/>
							<xs:attribute name="nullFlavor" type="NullFlavor" use="optional"/>
						</xs:complexType>
					</xs:element>
				</xs:sequence>
			</xs:choice>
		</xs:sequence>
		<xs:attribute name="nullFlavor" type="NullFlavor" use="prohibited"/>
	</xs:complexType>
	<!-- Блоки "Сведения об источнике оплаты" и "Сведения о направившем лице, направившей организации" -->
	<xs:complexType name="POCD_MT000040.Participant_1">
		<xs:sequence>
			<xs:element name="associatedEntity" type="POCD_MT000040.AssociatedEntity_1" minOccurs="1" maxOccurs="1">
				<xs:annotation>
					<xs:documentation>источник оплаты и направившее лицо</xs:documentation>
				</xs:annotation>
			</xs:element>
		</xs:sequence>
		<xs:attribute name="typeCode" use="required">
			<xs:simpleType>
				<xs:restriction base="ParticipationType">
					<xs:enumeration value="IND"/>
					<xs:enumeration value="REF"/>
				</xs:restriction>
			</xs:simpleType>
		</xs:attribute>
		<xs:attribute name="nullFlavor" type="NullFlavor" use="prohibited"/>
	</xs:complexType>
	<xs:complexType name="POCD_MT000040.AssociatedEntity_1">
		<xs:sequence>
			<xs:choice>
				<!-- Блок "Сведения об источнике оплаты" -->
				<xs:sequence>
					<xs:element name="code" type="code_participant" minOccurs="1" maxOccurs="1">
						<xs:annotation>
							<xs:documentation>код источника оплаты</xs:documentation>
						</xs:annotation>
					</xs:element>
					<xs:element ref="identity:DocInfo" minOccurs="1" maxOccurs="1">
						<xs:annotation>
							<xs:documentation>документ-основание</xs:documentation>
						</xs:annotation>
					</xs:element>
				</xs:sequence>
				<!-- Блок "Сведения о направившем лице, направившей организации" -->
				<xs:sequence>
					<xs:element name="id" minOccurs="2" maxOccurs="2">
						<xs:annotation>
							<xs:documentation>уникальный идентификатор направившего лица в МИС</xs:documentation>
							<xs:documentation>СНИЛС направившего лица</xs:documentation>
						</xs:annotation>
						<xs:complexType>
							<xs:complexContent>
								<xs:restriction base="II">
									<xs:attribute name="root" use="optional">
										<xs:simpleType>
											<xs:restriction base="uid">
												<xs:pattern value="[0-2](\.(0|[1-9][0-9]*))*.70|1.2.643.100.3"/>
											</xs:restriction>
										</xs:simpleType>
									</xs:attribute>
									<xs:attribute name="extension" type="st" use="optional"/>
									<xs:attribute name="assigningAuthorityName" type="st" use="prohibited"/>
									<xs:attribute name="displayable" type="bl" use="prohibited"/>
									<xs:attribute name="nullFlavor" type="NullFlavor" use="optional"/>
								</xs:restriction>
							</xs:complexContent>
						</xs:complexType>
					</xs:element>
					<xs:element name="code" type="code_participant" minOccurs="1" maxOccurs="1">
						<xs:annotation>
							<xs:documentation>код должности направившего лица</xs:documentation>
						</xs:annotation>
					</xs:element>
					<!-- Блок "Адрес места работы направившего лица" -->
					<xs:element name="addr" minOccurs="0" maxOccurs="1">
						<xs:annotation>
							<xs:documentation>адрес направившего лица</xs:documentation>
						</xs:annotation>
						<xs:complexType>
							<xs:choice minOccurs="1">
								<xs:group ref="AD"/>
							</xs:choice>
							<xs:attribute name="use" use="optional" type="set_PostalAddressUse"/>
							<xs:attribute name="nullFlavor" type="NullFlavor" use="prohibited"/>
						</xs:complexType>
					</xs:element>
					<xs:element name="telecom" minOccurs="0" maxOccurs="unbounded">
						<xs:annotation>
							<xs:documentation>контакты направившего лица</xs:documentation>
						</xs:annotation>
						<xs:complexType>
							<xs:complexContent>
								<xs:restriction base="TEL">
									<xs:attribute name="value" type="url" use="required"/>
									<xs:attribute name="nullFlavor" type="NullFlavor" use="prohibited"/>
								</xs:restriction>
							</xs:complexContent>
						</xs:complexType>
					</xs:element>					
					<xs:element name="associatedPerson" type="POCD_MT000040.Person" minOccurs="1" maxOccurs="1">
						<xs:annotation>
							<xs:documentation>ФИО направившего лица</xs:documentation>
						</xs:annotation>
					</xs:element>
				</xs:sequence>
			</xs:choice>					
			<xs:element name="scopingOrganization" type="POCD_MT000040.Organization_1" minOccurs="0" maxOccurs="1">
				<xs:annotation>
					<xs:documentation>сведения об организации</xs:documentation>
				</xs:annotation>
			</xs:element>
		</xs:sequence>
		<xs:attribute name="classCode" use="required">
			<xs:simpleType>
				<xs:restriction base="RoleClassAssociative">
					<xs:enumeration value="GUAR"/>
					<xs:enumeration value="PROV"/>
				</xs:restriction>
			</xs:simpleType>
		</xs:attribute>
		<xs:attribute name="nullFlavor" type="NullFlavor" use="prohibited"/>		
	</xs:complexType>
	<xs:complexType name="code_participant">
		<xs:complexContent>
			<xs:restriction base="CE_non_elements">
				<xs:attribute name="code" type="cs" use="required"/>
				<xs:attribute name="codeSystem" use="required">
					<xs:simpleType>
						<xs:restriction base="uid">
							<xs:enumeration value="1.2.643.5.1.13.13.11.1039"/>
							<xs:enumeration value="1.2.643.5.1.13.13.11.1002"/>
						</xs:restriction>
					</xs:simpleType>
				</xs:attribute>
				<xs:attribute name="codeSystemName" type="st" use="required"/>
				<xs:attribute name="codeSystemVersion" type="st" use="required"/>
				<xs:attribute name="displayName" type="st" use="required"/>
				<xs:attribute name="nullFlavor" type="NullFlavor" use="prohibited"/>
			</xs:restriction>
		</xs:complexContent>
	</xs:complexType>
</xs:schema>
